const KEY = 'hm-tt-pc-userinfo'
//  存储用户信息
const setUser = (user) => {
  localStorage.setItem(KEY, JSON.stringify(user))
}

/**
 * 取出用户信息
 */
const getUser = () => {
  const result = JSON.parse(localStorage.getItem(KEY)) || {}
  // console.log('getuser', result)
  return result
}
//  退出时删除本地的token
const delUser = () => {
  localStorage.removeItem(KEY)
}
export {
  setUser,
  getUser,
  delUser
}
